package com.oop9.drawingProgram;

public class Triangle extends Image {

	private double a;
	private double b;
	private double c;
	private double h;

	public double getA() {
		return a;
	}

	public void setA(double a) {
		this.a = a;
	}

	public double getB() {
		return b;
	}

	public void setB(double b) {
		this.b = b;
	}

	public double getC() {
		return c;
	}

	public void setC(double c) {
		this.c = c;
	}

	public double getH() {
		return h;
	}

	public void setH(double h) {
		this.h = h;
	}

	@Override
	public void perimeter() {
		// TODO Auto-generated method stub
		System.out.println("三角形的周长是：" + (this.a + this.b + this.c));

	}

	@Override
	public void area() {
		// TODO Auto-generated method stub
		System.out.println("三角形的面积是：" + (this.a * this.h) / 2);
	}

	public Triangle(double a, double b, double c, double h) {
		super();
		this.a = a;
		this.b = b;
		this.c = c;
		this.h = h;
	}

}
